home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_ghostscript.idb / usr / freeware / doc / ghostscript / 3.33 / make.doc.z / make.doc
Encoding:
Text File  |  1998-05-21  |  34.2 KB  |  817 lines

  1.    Copyright (C) 1989, 1995 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of GNU Ghostscript.
  4.   
  5.   GNU Ghostscript is distributed in the hope that it will be useful, but
  6.   WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility to
  7.   anyone for the consequences of using it or for whether it serves any
  8.   particular purpose or works at all, unless he says so in writing.  Refer
  9.   to the GNU Ghostscript General Public License for full details.
  10.   
  11.  
  12. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13.  
  14. This file, make.doc, describes how to install Ghostscript, and how to
  15. build Ghostscript executables from source.
  16.  
  17. For an overview of Ghostscript and a list of the documentation files, see
  18. README.
  19.  
  20. ********
  21. ******** Installing Ghostscript
  22. ********
  23.  
  24. To install the interpreter, you need:
  25.     - The interpreter executable:
  26.         - On MS-DOS systems:
  27.             - With 80286 CPUs, gs.exe.
  28.             - With 32-bit CPUs and using the Watcom compiler,
  29.               gs386.exe and the DOS extender dos4gw.exe.
  30.             - With 32-bit CPUs and using the DJGPP compiler,
  31.               gs.exe and the DOS extender go32.exe.
  32.         - On MS Windows:
  33.             - Ordinarily, gswin.exe.
  34.             - With Win32s, gswin32.exe.
  35.         - On MS Windows NT, gswin32.exe.
  36.         - On OS/2, gsos2.exe and gspmdrv.exe.
  37.         - On VMS systems, gs.exe.
  38.         - On Unix systems, gs.
  39.     - The interpreter initialization files:    gs_*.ps.
  40.     - The font map: Fontmap.
  41.  
  42. See use.doc for a description of the search algorithm used to find these
  43. files.
  44.  
  45. You do not need any of these files when using the library; however, the
  46. library currently provides no way to install fonts.  This is obviously
  47. ridiculous and will be fixed sometime in the future.
  48.  
  49. ********
  50. ******** Building Ghostscript from source
  51. ********
  52.  
  53. Ghostscript is generally distributed in the form of a compressed tar file
  54. (.tar.gz).  When unpacked, this file puts all the Ghostscript files in a
  55. directory called gsA.BC, where A.BC is the version number.  Ghostscript is
  56. also available in the form of PC-compatible .zip files.
  57.  
  58. Ghostscript uses a library provided by the Independent JPEG Group.  This
  59. library is included in the Ghostscript distribution in a separate file.  If
  60. you already have a copy of a version of this library that is compatible
  61. with Ghostscript, you won't have to FTP or unpack it again.  Please see the
  62. file jpeg.mak for information about which version(s) of the IJG code are
  63. compatible with Ghostscript.  This library does not include the gsA.BC
  64. prefix; you should make the gsA.BC directory current before you unpack the
  65. JPEG archive.
  66.  
  67. Ghostscript is described by a collection of several makefiles:
  68.  
  69.     gs.mak, jpeg.mak - generic makefiles used on all platforms
  70.       (except VMS).
  71.     devs.mak - a makefile listing all the device drivers.
  72.     *.mak - the makefiles for specific platforms.
  73.  
  74. You may need to edit the platform-specific makefile if you wish to change
  75. any of the following:
  76.  
  77.     - The name of the makefile itself (MAKEFILE macro);
  78.  
  79.     - The default search path(s) for the initialization and font files
  80.       (GS LIB_DEFAULT_macro);
  81.  
  82.     - The debugging options (DEBUG and TDEBUG macros);
  83.  
  84.     - The set of device drivers to be included (DEVICE_DEVS
  85.       and DEVICE_DEVS1..9 macros);
  86.  
  87.     - The set of optional features to be included (FEATURE_DEVS macro).
  88.  
  89. The platform-specific makefile will include comments describing all of
  90. these items except the DEVICE_DEVS options; the available DEVICE_DEVS
  91. options (device drivers) are described in devs.mak, even though the file
  92. that must be edited is the platform-specific makefile.  (These comments do
  93. not apply to the VMS platform; it has its own procedures, which are
  94. described near the end of this document.)
  95.  
  96. The makefiles distributed with Ghostscript define these options as
  97. follows:
  98.  
  99.     - MAKEFILE: the xxx.mak name of the makefile as distributed
  100.       (platform-specific).
  101.  
  102.     - GS_LIB_DEFAULT: on Unix systems, /usr/local/lib/ghostscript and
  103.       /usr/local/lib/ghostscript/fonts; on MS-DOS systems, . and C:\GS.
  104.       Note that on Unix systems, GS_LIB_DEFAULT does not include . (the
  105.       current directory).
  106.  
  107.     - DEBUG, TDEBUG: no debugging code included in the build.
  108.  
  109.     - DEVICE_DEVS*: platform-specific, see below.
  110.  
  111.     - FEATURE_DEVS: platform-specific.
  112.  
  113. There are also platform-specific options described below under the
  114. individual platforms.  See the "Options" section near the beginning of the
  115. relevant makefile for more information.
  116.  
  117. If you are including a dot-matrix printer driver, you may wish to
  118. customize the default resolution parameters in devs.mak.
  119.  
  120. To build the interpreter, you need all the .h and .c files (and .asm files
  121. for MS-DOS) included in the distribution, as well as the makefiles.
  122.  
  123. The command
  124.     make clean
  125. removes all the files created by the build process (relocatables,
  126. executables, and miscellaneous scratch files).  If you want to save the
  127. executable, you should move it to another directory first.
  128.  
  129. Features and devices
  130. --------------------
  131.  
  132. When compiling Ghostscript, you may configure it with any of a variety of
  133. features, and with any subset of the available device drivers.  You will
  134. find the complete list of features in a comment at the beginning of the file
  135. gs.mak, and the complete list of drivers in a comment at the beginning of
  136. devs.mak.
  137.  
  138. To find out what devices a particular makefile selects for inclusion in
  139. the executable, find the lines in the makefile of the form
  140.     FEATURE_DEVS=<list of features>
  141. and
  142.     DEVICE_DEVS=<list of devices>
  143.     (similarly DEVICE_DEVS1... up to DEVICE_DEVS15)
  144. For example, the makefile for Unix platforms defines
  145.     FEATURE_DEVS=level2.dev
  146. indicating that the PostScript Level 2 facilities should be included.  You
  147. may wish to change this to
  148.     FEATURE_DEVS=level2.dev pdf.dev
  149. to add the ability to interpret PDF files.  The Unix makefile also defines
  150.     DEVICE_DEVS=x11.dev
  151.     DEVICE_DEVS9=pbm.dev pbmraw.dev pgm.dev pgmraw.dev ppm.dev ppmraw.dev
  152. indicating that the X11 driver and all of the Portable Bit/Gray/PixMap
  153. file drivers should be included.
  154.  
  155. You may edit the FEATURE_DEVS line to select any desired set of features (as
  156. listed near the beginning of gs.mak), and the DEVICE_DEVS* line(s) to select
  157. any desired set of device drivers (as listed near the beginning of
  158. devs.mak).  The first device listed in the definition of DEVICE_DEVS will be
  159. used as the default device (unless overridden from the command line with
  160. -sDEVICE=xxx, of course.)  If you can't fit all the devices on a single
  161. line, you may add lines defining
  162.     DEVICE_DEVS2=<dev21>.dev ... <dev2n>.dev
  163.     DEVICE_DEVS3=<dev31>.dev ... <dev3n>.dev
  164. etc. up to DEVICE_DEVS15.  Don't use continuation lines -- this doesn't
  165. work on some platforms.
  166.  
  167. ********
  168. ******** How to build Ghostscript from source (PC version) ********
  169. ********
  170.  
  171. The relevant makefiles are:
  172.     Turbo C: tc.mak
  173.     Turbo C++/Borland C++, MS-DOS: bc.mak
  174.     Borland C++, MS Windows: bcwin.mak
  175.     Borland C++ 4.0, MS Windows with Win32s or MS Windows NT: bcwin32.mak
  176.     Microsoft C/C++ 7.0, MS-DOS: msc.mak
  177.     Watcom C/386 or C++, MS-DOS: watc.mak
  178.     Watcom C/386 or C++, MS Windows (NOT DEBUGGED YET): watcwin.mak
  179.     DJGPP, DESQview/X: dvx-gcc.mak
  180. The options were chosen to strike a balance between RAM consumption and
  181. likely usefulness.  (Turbo C is limited to 640K and does not support code
  182. overlaying; Borland C++ is limited to 640K, but supports code overlaying
  183. under MS-DOS; the Watcom and DJGPP compilers are not limited to 640K.)
  184.  
  185. To build Ghostscript, you need MS-DOS version 3.3 or later, and a (Borland)
  186. Turbo C/C++, Borland C/C++, Microsoft C/C++ (version 7), Watcom C/386
  187. (version 8.5 or later) or C++ (any version), or the free djgpp + go32
  188. development system.  Details are given below.
  189.  
  190. As noted above, the default configuration generates an executable that
  191. assumes the directory where 'make' was run should be the final default
  192. directory for looking up the Ghostscript initialization and font files.
  193.  
  194. To build the Ghostscript executable, all you need to do is give the
  195. command
  196.     make
  197. You must have COMMAND.COM in your path to build Ghostscript.
  198.  
  199. There is a special 'make' target that simply attempts to compile all the
  200. .c files in the current directory.  Some of these compilations will fail,
  201. but the ones that succeed will go considerably faster, because they don't
  202. individually pay the overhead of loading the compiler into memory.  So a
  203. good strategy for building the executable for the first time, or after a
  204. change to a very widely used .h file, is:
  205.     make begin
  206. and then
  207.     make
  208. to do the compilations that failed the first time.
  209.  
  210. Note: if you get the Ghostscript sources from a Unix 'tar' file and unpack
  211. the file on a MS-DOS machine, the files will all have linefeed instead of
  212. carriage return + linefeed as the line terminator, which may make the C
  213. compiler unhappy.  I don't know the simplest way to fix this: just reading
  214. each file into an editor and writing it back out again may be sufficient.
  215. You will probably have to do this to the .c, .h, and .bat files.
  216.  
  217. Borland environment
  218. -------------------
  219.  
  220. To compile Ghostscript with the Borland environment, you need either Turbo
  221. C (version 2.0 or later) or Turbo C++ or Borland C++ (version 1.0 or
  222. later); specifically, the compiler, 'make' utility, and linker.  You also
  223. need either the Borland assembler (version 1.0 or later) or the Microsoft
  224. assembler (version 4.0 or later).  Before compiling or linking, you should
  225. execute
  226.     echo !include "tc.mak" >makefile
  227. (for Turbo C and MS-DOS), or
  228.     echo !include "bc.mak" >makefile
  229. (for Turbo C++ or Borland C++ and MS-DOS), or
  230.     echo !include "bcwin.mak" >makefile
  231. (for Turbo C++ or Borland C++ and Microsoft Windows), or
  232.     echo !include "bcwin32.mak" >makefile
  233. (for Borland C++ and Microsoft Windows with Win32s or Microsoft Windows NT)
  234.  
  235. Besides the source files and the makefiles, you need:
  236.     turboc.cfg (the flags and switches for Turbo C)
  237.     gs.tr (the linker commands for the interpreter)
  238.     *.bat (a variety of batch files used in the build process)
  239.  
  240. There are extensive comments in the aforementioned .mak files
  241. regarding various configuration parameters.  If your configuration is
  242. different from the following, you should definitely read those
  243. comments and see if you want or need to change any of the parameters:
  244.     - The compiler files are in c:\tc (for Turbo C) or c:\bc (for
  245. Turbo C++ or Borland C++) and its subdirectories.
  246.     - You are using the Borland assembler (tasm).
  247.     - You want an executable that will run on any PC-compatible,
  248. regardless of processor type (8088, 8086, V20, 80186, 80286, V30, 80386,
  249. 80486) and regardless of whether a math coprocessor (80x87) is present.
  250.  
  251. NOTE: Borland C++ 3.0 has two problems that affect Ghostscript (these
  252. problems are fixed in Borland C++ 3.1):
  253.  
  254.     - The assembler, tasm, often crashes when attempting to
  255. assemble gdevegaa.asm.  If this happens, try again, or use another
  256. assembler (e.g., an older version of tasm) if you have one, or set
  257. USE_ASM=0 in the makefile.
  258.  
  259.     - The math library for Microsoft Windows, mathwl.lib, has a
  260. bug that causes floating point numbers to print incorrectly.  Contact
  261. Borland for a corrected version.
  262.  
  263. If you are compiling Ghostscript with Turbo C++ 1.0, remove the
  264. `.swap' directive from bc.mak, and use the -s switch on the `make'
  265. command line.  (All later versions of the Borland environment
  266. recognize this directive.)
  267.  
  268. Note that although the Microsoft Windows version of Ghostscript will
  269. run under Windows 3.0, it uses routines from the Windows 3.1 SDK, so
  270. you need the Windows 3.1 SDK and header files to compile it.  In
  271. practice, this means that you need Borland C++ 3.1; Borland C++ 3.0
  272. doesn't include the necessary headers.
  273.  
  274. If building for the MS Windows Win32s environment, you need bcc32.cfg
  275. instead of turboc.cfg.  The make process will stop after it has created
  276. genarch.exe.  You should then run 'win genarch arch.h', wait until genarch
  277. has finished and then exit MS Windows.  Then type 'make' again to restart
  278. the make process.
  279.  
  280. If building for MS Windows NT, you also need bcc32.cfg instead of
  281. turboc.cfg, but the make process will run to completion automatically.
  282.  
  283. Microsoft environment
  284. ---------------------
  285.  
  286. To compile Ghostscript with the Microsoft environment, you need Microsoft
  287. Visual C++ 1.0 or later with its associated `nmake' utility and linker.
  288. Before compiling or linking, you should execute
  289.     echo !include msc.mak >makefile
  290.  
  291. Besides the source files and the makefiles, you need:
  292.     gs.tr (the linker commands for the interpreter)
  293.     *.bat (a variety of batch files used in the build process)
  294.  
  295. All previous versions of Microsoft C/C++ are of such poor quality that we
  296. strongly advise you not to attempt to compile Ghostscript with them.  In
  297. particular, C/C++ 7.0 is the first version that is even close to being
  298. ANSI-compliant, and its 'nmake' program is very unreliable (it crashes
  299. partway through the build process with a variety of error messages, or no
  300. error message) and cannot write its error messages to a file.
  301.  
  302. Aladdin Enterprises does not currently have a copy of the Microsoft
  303. compiler.  If you encounter problems with it, we will not be able to help
  304. you; please post them to the Usenet gnu.ghostscript.bug newsgroup.
  305.  
  306. Watcom environment
  307. ------------------
  308.  
  309. Before compiling, change the definition of the WCVERSION macro in the
  310. makefile (watc.mak or watcwin.mak) to the version of the Watcom compiler you
  311. are using.  This is necessary to handle some minor incompatibilities between
  312. versions.
  313.  
  314. To avoid annoying messages from the DOS extender, add the line
  315.     set DOS4G=quiet
  316. to your autoexec.bat file. 
  317.  
  318. To compile Ghostscript with the Watcom compiler, create a makefile by
  319. executing
  320.  
  321.     echo !include watc.mak >makefile
  322.  
  323. To build Ghostscript, execute
  324.  
  325.     wmakel -u
  326.  
  327. Note that Watcom C/386 version 8.5 does not include wmakel (the 32-bit
  328. version of wmake).  If this is the version that you have, try using wmake
  329. instead, i.e.,
  330.  
  331.     wmake -u
  332.  
  333. If you get an "Error(F01): Out of memory", you may wish to try reducing
  334. the total size of the makefiles by editing devs.mak to remove drivers that
  335. you don't ever intend to use.  If you still get this error, contact Watcom
  336. technical support; they will be able to send you the wmakel program,
  337. probably at no charge.
  338.  
  339. DesqView/X and djgcc environment
  340. --------------------------------
  341.  
  342. The name of the makefile for this environment is dvx-gcc.mak.
  343.  
  344. The DesqView/X port of Ghostscript was contributed by Tom Brosnan
  345. (tjb@chalone.stanford.edu), with further contributions by Stephen Turnbull
  346. (turnbull@shako.sk.tsukuba.ac.jp).  It uses djgcc (DJ Delorie's MSDOS port
  347. of gcc) for compiling.  djgcc assumes that go32.exe is in your search path.
  348. You need to set an environment variable to tell go32 where to put any
  349. paging files, e.g.
  350.  
  351.     set GO32TMP=e:/tmp
  352.  
  353. If you don't have go32.exe, you can get it from Internet host
  354. oak.oakland.edu.  The extender and minimum run-time environment are in the
  355. file djeoeXXX.zip, where XXX is the version number (currently 112).
  356. Patched versions of the extender (as well as other components) are found in
  357. the files djXXXmY.zip, XXX is again the compiler version, Y is the
  358. patchlevel.  Y is currently 2.  People who are just running the executable
  359. need only get the file with the highest level of Y that contains GO32.EXE
  360. and do "unzip -j djXXXmY go32.exe" (InfoZIP) or "pkunzip djXXXmY go32.exe"
  361. (PKWare), then move the extender to their PATH.  If you do not have a
  362. hardware FPU, you will also need the floating point emulator EMU387 found
  363. in djeoeXXX.zip (and possibly in the patch releases as well).  You MUST use
  364. an emulator designed to work with GO32; the emulators often found as TSRs
  365. will not work.  See the file README found in djeoeXXX.zip, or the file
  366. README.1ST in pub/msdos/djgpp on Simtel for further information.
  367.  
  368. The DJGPP v1.12 compiler suite is known to have problems with linking
  369. large file sets.  If you run into this problem, you can work around it
  370. by using the v1.11 GO32 as follows:
  371. (1) get dj111m5.zip from turnbull.sk.tsukuba.ac.jp:/pub/djgpp/1.11
  372. (2) unzip GO32.EXE.  Be careful not to overwrite other versions!
  373. (3) rename it, eg, to GO111M5.EXE
  374. (4) move the renamed GO32.EXE to your path
  375. (5) stubedit ld.exe:  (the stubedit utility is part of djeoe112.zip)
  376.     (a) change the extender name to the one you chose in (3).  The
  377.         .EXE extension may be omitted
  378.     (b) change the version required to 1.11
  379.     (c) accept the defaults for the remaining options.
  380.  
  381. ********
  382. ******** How to build Ghostscript from source (OS/2 version) ********
  383. ********
  384.  
  385. The relevant makefile is:
  386.     os2.mak
  387. The EMX/GCC 0.8h compiler and the IBM NMAKE.EXE are required.
  388.  
  389. Before compiling or linking, you should execute
  390.     copy os2.mak makefile
  391. Then to start the make process type
  392.     nmake
  393. Two EXE's will be produced: gsos2.exe (Ghostscript) and gspmdrv.exe (the
  394. Presentation Manager display driver).  gsos2.exe will also run under MS-DOS
  395. if a device other than os2pm is selected.
  396.  
  397. ********
  398. ******** How to build Ghostscript from source (Unix version) ********
  399. ********
  400.  
  401. The makefile distributed with Ghostscript selects the following devices
  402. for inclusion in the build:
  403.     Display: X Windows driver.
  404.     File output: pbm, pbmraw, pgm, pgmraw, ppm, and ppmraw drivers.
  405.  
  406. Before compiling or linking, you should execute
  407.  
  408.     ln -s unix-cc.mak makefile
  409. or    ln -s unix-gcc.mak makefile
  410. or    ln -s unixansi.mak makefile
  411.  
  412. (if your Unix system doesn't support symbolic links, omit the -s switch)
  413. depending on whether your C compiler is a traditional Kernighan & Ritchie C
  414. compiler, gcc, or an ANSI C compiler other than gcc respectively.  (If you
  415. want to use gcc in traditional mode, use unix-cc.mak and define the CC macro
  416. to refer to gcc.)
  417.  
  418. The unix-*.mak files are actually generated mechanically from *head.mak,
  419. *tail.mak, unix-end.mak, gs.mak, jpeg.mak, and devs.mak by a script called
  420. tar_cat.  If for some reason your copy of Ghostscript doesn't include the
  421. unix-*.mak files, run tar_cat to construct them.  If you wish to edit any part
  422. of the makefile,
  423.  
  424.     DO NOT EDIT THE FILE NAMED makefile OR unix{ansi,cc,gcc}.mak.
  425.     EDIT THE ORIGINAL COMPONENT MAKEFILE (*head.mak, *tail.mak,
  426.     unix-end.mak, gs.mak, jpeg.mak, OR devs.mak) AND RUN tar_cat AGAIN.
  427.  
  428. Consult tar_cat to find the names of the component files.
  429.  
  430. If the X11 client header files are located in some directory which your
  431. compiler does not automatically search, you must change the XINCLUDE macro
  432. the makefile to include a specific -I switch.  See the comment preceding
  433. XINCLUDE in the makefile.
  434.  
  435. Currently Ghostscript is set up to compile and link in a generic Unix
  436. environment.  Some Unix environments may require changing the LDFLAGS
  437. macro in the makefile.
  438.  
  439. All you need to do to make an executable is invoke the shell command
  440.     make
  441.  
  442. Ghostscript uses ANSI syntax for function definitions. Because of this,
  443. when compiling with cc, it must preprocess each .c file to convert it to
  444. the older syntax defined in Kernighan and Ritchie, which is what most
  445. current Unix compilers (other than gcc) support.  This step is
  446. automatically performed by a utility called ansi2knr, which is included in
  447. the Ghostscript distribution.  The makefile automatically builds ansi2knr.
  448.  
  449. The ansi2knr preprocessing step is included in the makefile rule for
  450. compiling .c files.  ansi2knr creates a file called _temp_.c to hold the
  451. converted code.  If you want to change this name for some reason, it is
  452. defined in unix-cc.mak.
  453.  
  454. Platform-specific notes
  455. -----------------------
  456.  
  457. 386 Unix:
  458.     gcc versions older than 1.38 on Intel 80386 systems do not
  459. compile Ghostscript correctly using the -O option.  Do not use -O in
  460. these environments.
  461.     gcc 1.39 under 386BSD has a bug that causes float-to-integer
  462. conversions to compile incorrectly.  Do not use this version of gcc.
  463.     X11R5 may need #include <stddef.h> in x_.h.
  464.     Also see below regarding System V platforms.
  465.  
  466. Alpha (AXP) with OSF/1.2:
  467.     The optimizer in cc is broken.  If you are compiling with cc, use
  468. the unixansi.mak makefile, and the command line
  469.         make CC=cc CFLAGS= EXTRALIBS=-lXmu
  470.     If you are compiling with gcc, use version 2.5.0 or later, with
  471. the unix-gcc.mak makefile, and the command line
  472.         make CFLAGS=-O2 EXTRALIBS=-lXmu
  473. (libXmu is needed to resolve reference _XEditResCheck from libXt, which is
  474. peculiar to OSF/1.)
  475.     You will probably need to change the definition of INSTALL in the
  476. makefile from install to installbsd.
  477.  
  478. Alpha (AXP) with OSF/1.3:
  479.     The optimizer is OK, but needs to be told to allocate extra table
  480. space to be able to handle some of the larger files:
  481.         make CC=cc CFLAGS="-Olimit 1000"
  482.     The linker in the c89 compiler is broken, so even if you compile
  483. with c89, you must link with cc.  You do not need to set EXTRALIBS=-lXmu.
  484.     You will probably need to change the definition of INSTALL in the
  485. makefile from install to installbsd.
  486.  
  487. Alpha (AXP) with OpenVMS:
  488.     DEC C V4.0 or later is required.  The DEC C V1.3 run-time library
  489. has bugs that prevent Ghostscript from working.
  490.  
  491. Apollo:
  492.     You must run the compiler in ANSI-compatible mode (i.e., set AK=
  493. <null string> in the makefile); otherwise, it gives incorrect error
  494. messages for any function declared as returning a float value.
  495.     The Apollo compiler may not compile Ghostscript correctly.  If you
  496. get unexpected crashes at run time, use gcc.
  497.  
  498. AT&T 7040 R3:
  499.     If Ghostscript crashes on startup, recompile with -O0 in order to
  500. avoid triggering compiler bugs.
  501.  
  502. Convex:
  503.     Use unixansi.mak.  Do not invoke optimization (-O1): there
  504. are compiler bugs that lead to incorrect code.  Set CFLAGS to
  505.     -no -fn -tm c1
  506.  
  507. DEC:
  508.     See Alpha (above) or VAX (below).  Also, you may get the following
  509. message (or a similar one) when compiling on a DECstation, due to a
  510. compiler bug:
  511.     cfe: Fatal: _temp_19086.c: Segmentation violation
  512. If this happens, try compiling with the -oldc switch.
  513.  
  514. DECStations with Ultrix:
  515.     You may wish to set
  516.   GS_LIB_DEFAULT=$(gsdatadir):/usr/lib/DPS/outline/decwin:$(gsdatadir)/fonts
  517. in the makefile to add the Display PostScript font directory to the font
  518. search path.
  519.     You may need to use
  520.         make CFLAGS="-Olimit 1000"
  521. to tell the optimizer to allocate extra table space.
  522.     The Ultrix 4.4 C compiler has a bug that makes it compile gdevm1.c
  523. incorrectly.  Insert the following line in the makefile rule for
  524. gdevm1.$(OBJ) (the body of the rule is empty in the standard distribution):
  525.     $(CCC) -oldc gdevm1.c
  526.  
  527. GNU make (any platform):
  528.     GNU make 3.59 can't handle the final linking step in some cases;
  529. use the platform's standard make (e.g., /bin/make) if this happens.
  530.     
  531. H-P RISC workstations:
  532.     If you are using H-P's compiler, use the compiler flags -Ae +O3
  533. (*not* -O) -DNOSYSTIME.  You may also need -D_POSIX_SOURCE.  In addition,
  534. if you get the error message
  535.     Initializing... Unrecoverable error: typecheck in .registerencoding
  536.     Operand stack:
  537.         .notdef  0
  538. when you start Ghostscript, you need to install the following patches to
  539. fix bugs in H-P's C compiler: PHSS_2199, PHSS_3015, PHSS_3537.
  540.     If you are using gcc 2.5.8, use -O, not -O2; the latter generates
  541. incorrect code for at least one module (gsimage.c).
  542.  
  543. Intergraph Clipper:
  544.     Recommended settings are:
  545.         XCFLAGS=-w -Q -DSYSV -D__SVR3
  546.         EXTRALIBS=-lbsd -lc_s
  547.         CC=acc -knr
  548.         PLATFORM=sysv_
  549. Also, you will probably need to change the X11 driver specification from
  550.     $(SHP)gsaddmod x11 -lib Xt X11 Xext
  551. to
  552.     $(SHP)gsaddmod x11 -lib Xt_s X11_s Xext
  553.  
  554. ISC Unix:
  555.     For ISC Unix with gcc, an appropriate make invocation is:
  556.     make XCFLAGS="-D__SVR3 -posix" LDFLAGS="-shlib -posix" \
  557.          EXTRALIBS="-linet -lnsl_s"
  558. If this doesn't work for you, try removing the -shlib.  ISC Unix may
  559. also need one or more of the following in EXTRALIBS: -lpt, -lc_s.
  560. See also under "386 Unix" above.
  561.  
  562. MIPS:
  563.     There is apparently a bug in the MIPS C compiler which causes
  564. gxdither.c to compile incorrectly if optimization is enabled (-O).  Until
  565. a work-around is found, do not use -O with the MIPS C compiler.
  566.  
  567. NCR 3550:
  568.     If you are using the NCR C Development Toolkit, you must use -O0 to
  569. avoid triggering compiler bugs.
  570.  
  571. NeXTSTEP:
  572.     Use unix-gcc.mak, but change the name of the compiler (CC=) from gcc
  573. to cc.  For NeXTSTEP versions before 3.2, include -D_NEXT_SOURCE in CFLAGS,
  574. change the two occurrences of sys/time.h to ansi/time.h, and change
  575. <dirent.h> in gp_unifs.c to <sys/dirent.h>; for NeXTSTEP versions 3.2 and
  576. later, include -D_POSIX_SOURCE in CFLAGS, and do not make the other changes.
  577. You may also find it useful to add the following line to Fontmap:
  578.         /Ohlfs    /Courier    ;
  579.     If you are running the Pencom co-Xist X server, it installs the X
  580. headers and libraries in the default places, so you should change the
  581. definitions of XINCLUDE and XLIBDIRS in the makefile to empty strings.
  582.  
  583. Pyramid MIServer-S:
  584.     See AT&T 7040 R3.
  585.  
  586. RS/6000:
  587.     Many versions of the AIX C compiler have bugs that have prevented
  588. Ghostscript from compiling and linking properly.  We believe that the
  589. current Ghostscript release works around these bugs, and that using the
  590. unix-cc.mak makefile with
  591.     CC=cc
  592. should work.  You must also edit the makefile (unixansi.mak or
  593. unix-cc.mak) to change INSTALL to /usr/ucb/install.  (If -DSYSV produces a
  594. complaint about the functions index and rindex not being defined, try
  595. removing it.)  If the xlc 1.2.1 optimizer runs out of memory, you may need
  596. to add -qmaxmem=4000 to CFLAGS.
  597.     A user has reported that the AIX C compiler shipped with AIX 3.2.5
  598. only compiles Ghostscript if invoked with c89 -D_POSIX_SOURCE and *without*
  599. -O.  On the other hand, another user reported successful compilation using
  600. the unix-ansi.mak makefile and the following command line:
  601.     make CC=c89 XCFLAGS="-DOSY_AIX -D_ALL_SOURCE -qnoro -qmaxmem=3000 -bfl" $*
  602. Apparently some (but not all) releases of the C library declare the hypot
  603. function: if the declaration in math_.h produces an error message, try
  604. removing it.  Also, the IBM X11R3 server is known to be buggy: use the MIT
  605. X server if possible.
  606.  
  607. SCO Unix/Xenix:
  608.     The SCO Unix C compiler apparently can't handle the Pn macros
  609. in std.h.  If you get strange compilation errors on SCO Unix, see if
  610. you can get a compiler fix from SCO.  Meanwhile, to use gcc with SCO
  611. ODT, see gcc-head.mak for the appropriate switch settings.  See also
  612. under "386 Unix" above.
  613.     gcc 2.3.3 produces code that causes a core dump on machines
  614. that don't have hardware floating point, because of a bug in SCO's
  615. floating point emulator.  Use a different compiler on these machines.
  616.     If you aren't using the X11 driver, you need to add -lsocket
  617. to the linker command (near the end of the unix-*.mak file) in order
  618. to get the date/time functions linked in.
  619.     If you want to use direct frame buffer addressing instead of X
  620. Windows, include the relevant frame buffer device(s) (ega.dev, vga.dev,
  621. etc.) and change gdevevga.c to gdevsco.c as indicated in devs.mak.  Note:
  622. this does not work with SuperVGA displays, except for 800x600x16 mode.
  623. Note also: If the display looks "smeared", try recompiling gdevpcfb.c with
  624. -O0.  Note also: if Ghostscript crashes, use the -q switch and/or redirect
  625. console output to a file.
  626.     If your compiler accepts the -Xt and -Xa switches, use -Xt.
  627. Even though this causes the compiler to use incorrect rules for
  628. computing the result types of << and >>, -Xa enables "optimizations"
  629. that produce incorrect code.
  630.     For SCO ODT 2.0, in addition to -D__SVR3 and -DSYSV, you need to
  631. specify -Dsco, -DUSG, and -DMALLOC_0_RETURNS_NULL.  For SCO ODT, you need
  632. EXTRALIBS=-lX11 -lsocket -lmalloc, or maybe only -lsocket (depending on
  633. the version), and for SCO ODT 2.0, you also need to specify -lc_s.  For
  634. SCO Xenix, you need EXTRALIBS=-lmalloc.
  635.     For all SCO systems, set XINCLUDE= and XLIBDIRS=.
  636.     Please also read the section on "System V Unix platforms" below.
  637.  
  638. SGI:
  639.     The SGI C compiler shipped with Irix 5.2 requires compiler
  640. options -cckr.
  641.  
  642. Sun:
  643.     The Sun unbundled C compiler (SC1.0) doesn't compile Ghostscript
  644. properly if the -fast option is selected: Ghostscript core-dumps in
  645. build_gs_font.  Use -g, or use gcc.
  646.     The Sun version of dbx often gives up with an error message when
  647. trying to load Ghostscript.  If this happens, use gdb instead.  (gdb is
  648. more reliable than dbx in other ways as well.)
  649.     Solaris 2.2 may require setting EXTRALIBS=-lsocket.
  650.     Solaris 2.n uses /usr/openwin/share/include for the X11 libraries
  651. rather than /usr/local/X/include.
  652.     For Solaris 3.n, you will need to change the definition of INSTALL in
  653. the makefile from install -c to installbsd -c, since the Solaris version of
  654. 'install' requires
  655.         install -c <directory> [-m <mode>] <file>
  656. rather than
  657.         install [-c] [-m <mode>] <file> <directory>
  658.  
  659. SVR4 Unix platforms:
  660.     You may need to set EXTRALIBS=-lnsl.
  661.     Do *not* change PLATFORM=unix_ to PLATFORM=sysv_.
  662.     On SVR4 platforms that use dynamic library loading, you may need to
  663. add the following two lines to the makefile just before the final linking
  664. step (the line that says "$(SH) <ldt.tr"):
  665.         LD_RUN_PATH=$(XLIBDIR); \
  666.         export LD_RUN_PATH; \
  667.  
  668. System V Unix platforms:
  669.     If you are using a stock System V platform that lacks rename
  670. and gettimeofday, change PLATFORM=unix_ in the makefile to
  671. PLATFORM=sysv_.
  672.     You will probably need to change the definition of INSTALL (near
  673. the beginning of the makefile) from install to /usr/ucb/install.
  674.  
  675. VAX with [Open]VMS:
  676.     DEC C V4.0 or later is required.  Previous versions of the DEC C
  677. run-time library have bugs that prevent Ghostscript from working.
  678.  
  679. VAX with Ultrix:
  680.     The above information about DECStations with Ultrix may be
  681. applicable.
  682.  
  683. ********
  684. ******** How to build Ghostscript from source (VMS aka OpenVMS version) ****
  685. ********
  686.  
  687. The files VMS-CC.MAK, VMS-GCC.MAK, and VMS-DECC.MAK are OpenVMS DCL command
  688. files which build Ghostscript from scratch using, respectively, the VAX C
  689. compiler, CC, the Free Software Foundation's GNU C compiler, GCC, or the
  690. DEC C compiler, CC.  Accordingly, you must have one of these compilers
  691. installed in order to build Ghostscript.  (Other C compilers may work: CC
  692. and GCC are the only two compilers tested to date.)  These command files
  693. build and store the Ghostscript library in the object library GS.OLB.  If
  694. you have DECwindows (X11) installed on your system, the executable image
  695. GS.EXE will also be built.
  696.  
  697. Some environments use the DWTLIBSHR library for providing the X
  698. Windows intrinsics, and some use the XTSHR library.  XTSHR is newer,
  699. and is part of the DECwindows/Motif product.  However, DEC is still
  700. distributing versions of VMS with DWTLIBSHR.  If your environment
  701. uses XTSHR, replace DWTLIBSHR in the list of link libraries with
  702. XTSHR.
  703.  
  704. Many versions of DEC's X server have bugs that produce broad bands of color
  705. where dither patterns should appear, or characters displayed white on top
  706. of black rectangles or not displayed at all.  If this happens, please
  707. consult the X Windows section of the use.doc file to find out how to work
  708. around these bugs using X resources; also report the problem to DEC, or
  709. whoever supplied your X server.
  710.  
  711. You may also wish to turn off the use of a backing pixmap with Ghostscript,
  712. either to work around X server memory limitations or bugs, or to obtain
  713. faster displaying at the expense of no redrawing when a Ghostscript window
  714. is restored from an icon or exposed after being occluded by another window.
  715. Again, use.doc contains information on how to do this.
  716.  
  717. For OpenVMS VAX platforms with VAX C, issue the DCL command
  718.     $ @VMS-CC.MAK
  719. to build Ghostscript.  For OpenVMS platforms with GNU C (either AXP or
  720. VAX), issue the DCL command
  721.     $ @VMS-GCC.MAK
  722. to build Ghostscript.  For OpenVMS platforms with DEC C (either AXP or
  723. VAX), issue the DCL command
  724.     $ @VMS-DECC.MAK
  725. to build Ghostscript.
  726.  
  727. The option "DEBUG" may be specified with either command file in order to
  728. build a debuggable Ghostscript configuration; e.g.,
  729.     $ @VMS-CC.MAK DEBUG
  730.  
  731. In order to specify switches and file names when invoking the interpreter,
  732. define GS as a foreign command:
  733.     $ GS == "$disk:[directory]GS.EXE"
  734. where "disk" and "directory" specify the disk and directory where Ghostscript
  735. is located.  For instance,
  736.     $ GS == "$DUA1:[GHOSTSCRIPT]GS.EXE"
  737. To allow the interpreter to be run from any directory, define the logical
  738. GS_LIB which points to the Ghostscript directory
  739.     $ DEFINE GS_LIB disk:[directory]
  740. This allows Ghostscript to locate its initialization files stored in the
  741. Ghostscript directory -- see use.doc for further details.  Finally, to
  742. invoke the interpreter, merely type GS.  Although DCL normally converts
  743. unquoted parameters to upper case, C programs receive their parameters in
  744. lower case.  That is, the command
  745.     $ GS -Isys$login:
  746. passes the switch "-isys$login" to the interpreter.  To preserve the
  747. case of switches, enclose them in double quotes; e.g.,
  748.     $ GS "-Isys$login:"
  749.  
  750. If you add compiled fonts to your system as described in the fonts.doc file,
  751. then add the font source file names to MODULES.LIS, add "ccfonts.dev" to the
  752. FEATURE_DEVS symbol in VMS-CC.MAK, VMS-GCC.MAK, or VMS-DECC.MAK,
  753.     $ FEATURE_DEVS = "level2.dev ccfonts.dev"
  754. and then specify the font names with the ccfonts1 symbol
  755.     $ ccfonts1 = "Courier Courier_Oblique Courier_Bold Courier_BoldOblique"
  756. If the line gets too long, add another line of the same form, e.g.,
  757.     $ ccfonts1 = "Courier Courier_Oblique Courier_Bold Courier_BoldOblique"
  758.     $ ccfonts2 = "Times_Roman Times_Italic Times_Bold Times_BoldItalic"
  759.  
  760. ********
  761. ******** A guide to the files ********
  762. ********
  763.  
  764. General
  765. -------
  766.  
  767. There are very few machine dependencies in Ghostscript.  A few of the .c
  768. files are machine-specific.  These have names of the form
  769.     gp_<platform>.c
  770. specifically
  771.     gp_dosfb.c (MS-DOS)
  772.     gp_dosfs.c (MS-DOS and MS Windows)
  773.     gp_itbc.c (MS-DOS, Borland compilers)
  774.     gp_iwatc.c (MS-DOS, Watcom or Microsoft compiler)
  775.     gp_msdos.c (MS-DOS and MS Windows)
  776.     gp_ntfs.c (MS-Windows Win32s and Windows NT)
  777.     gp_os2.c (OS/2)
  778.     gp_os9.c (OS-9)
  779.     gp_unifs.c (Unix or OS-9)
  780.     gp_unix.c (Unix)
  781.     gp_sysv.c (System V Unix)
  782.     gp_vms.c (VMS)
  783.     gp_win32.c (MS-Windows Win32s and Windows NT)
  784. There are also some machine-specific conditionals in files with names
  785. <something>_.h.  If you are going to extend Ghostscript to new
  786. machines or operating systems, you should check the *_.h files for
  787. ifdef's on things other than DEBUG, and you should probably count on
  788. making a new makefile and a new gp_ file.
  789.  
  790. Library
  791. -------
  792.  
  793. Files beginning with gs, gx, or gz (both .c and .h), other than gs.c
  794. and gsmain.c, are the Ghostscript library.  Files beginning with gdev
  795. are device drivers or related code, also part of the library.  Other
  796. files beginning with g are library files that don't fall neatly into
  797. either the kernel or the driver category.
  798.  
  799. Interpreter
  800. -----------
  801.  
  802. gs.c is the main program for the interactive language interpreter;
  803. gsmain.c is the top level of initialization code.  If you configure
  804. Ghostscript as a server rather than an interactive program, you will use
  805. gsmain.c but not gs.c.
  806.  
  807. Files named z*.c are Ghostscript operator files.  The names of the files
  808. generally follow the section headings of the operator summary in section
  809. 6.2 of the PostScript manual.
  810.  
  811. Files named i*.c, and *.h other than g*.h, are the rest of the
  812. interpreter.  See the makefile for a little more information on how the
  813. files are divided functionally.
  814.  
  815. Files named s*.c are a flexible stream package, including the Level 2
  816. PostScript 'filters' supported by Ghostscript.
  817.